Backlink: reference-notes-readme


Cross-Compiling Code

Dependencies

Before we can cross-compile code on our Kali box, we need to make sure we have the appropriate tools installed.

apt install mingw-w64

C

32-bit

i686-w64-mingw32-gcc hello.c -o hello32.exe

64-bit

x86_64-w64-mingw32-gcc hello.c -o hello64.exe

C++

32-bit

i686-w64-mingw32-g++ hello.cc -o hello32.exe

64-bit

x86-64-w64-mingw32-g++ hello.cc -o hello64.exe